x86/p2m: Stop other vcpus using a nested p2m before clearing it
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 7 Feb 2017 14:01:29 +0000 (14:01 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 8 Feb 2017 17:45:50 +0000 (17:45 +0000)
commit04dbb71096143b54f8b5e1acfce8d55150609d3f
treee774d6ff4b256fbdd5196aab261a754aa7ec3ae6
parent11c397c207dda26084be8a5da5bd78c74b4b3651
x86/p2m: Stop other vcpus using a nested p2m before clearing it

Until the IPI has completed, other processors might be running on this nested
p2m object.  clear_domain_page() does not guarantee to make 8-byte atomic
updates, which means that a pagewalk on a remote processor might encounter a
partial update.

This is currently safe as other issues prevents a nested p2m ever being shared
between two cpus (although this is contrary to the original plan).

Setting p2m->np2m_base to P2M_BASE_EADDR before the IPI ensures that the IPI'd
processors won't continue to use the flushed mappings.

While modifying this function, remove all the trailing whitespace and tweak
style in the affected areas.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Tim Deegan <tim@xen.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/mm/p2m.c